/** When your routing table is too long, you can split it into small modules**/

import Layout from '@/views/layout/Layout'

const productRouter = {
  path: '/post',
  component: Layout,
  redirect: '/post/index',
  name: 'post',
  meta: {
    title: 'post',
    icon: 'clipboard',
    roles:['other','admin','edit']
  },
  children: [
    {
      path: 'create',
      component: () => import('@/views/post/create'),
      name: 'postAdd',
      meta: { title: '创建文章', icon: 'edit' }
    },
    {
      path: 'edit/:id(\\d+)',
      component: () => import('@/views/post/edit'),
      name: 'postEdit',
      meta: { title: '编辑文章', noCache: true },
      hidden: true
    },
    {
      path: 'index',
      component: () => import('@/views/post/list'),
      name: 'postIndex',
      meta: { title: '文章列表', icon: 'list' }
    }
  ]
}
export default productRouter
